﻿@using QqhrCitizen.Models
@{
    ViewBag.Title = "修改产品";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    Product product = ViewBag.Product as Product;
}


<div>
    <div class="result-title">
        <h1 class="head-tietle">修改产品</h1>
    </div>
    @using (Html.BeginForm("ProductEdit", "Admin", FormMethod.Post))
    {
        @Html.AntiForgeryToken()
        <input value="@product.ID" name="ID" type="hidden" />
        <table class="detail-table">
            <tr>
                <td class="row-title">标题</td>
                <td>
                    <input class="textbox w-3" type="text" name="Title" value="@product.Title" />
                </td>
            </tr>
            <tr>
                <td class="row-title">
                    类型
                </td>
                <td>
                    <select name="ProductCategory" class="textbox">
                        <option value="1"  @(product.Belong==ProductBelong.产品?"selected":"")>产品</option>
                        <option value="2" @(product.Belong == ProductBelong.作品?"selected":"")>作品</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="row-title">描述</td>
                <td>
                    <textarea name="Description" rows="20" class="textbox w-3">@product.Description</textarea>
                </td>
            </tr>
            <tr>
                <td class="row-title">价格</td>
                <td>
                    <input class="textbox w-3" type="text" name="Price" value="@product.Price" />
                </td>
            </tr>
        </table>
        <p><input type="submit" value="保存" class="button blue" /><input class="button" onclick="history.go(-1)" value="返回" type="button"></p>
    }
</div>

